﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

using IQKS.AWP.BusinessAccessLayer;
using IQKS.AWP.BusinessObject;
public partial class Admin_RoleMaster : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            GetData();
           
        }

    }


    private void GetData()
    {
        gvUserRole.DataSource = GetDataSet();
        gvUserRole.DataBind();
    }

    private DataSet GetDataSet()
    {
        DataSet objDs=null;
        try
        {
            objDs = new RoleMasterBAL().GetAllRole();
        }
        catch (Exception exception)
        {
            exception.AddErrorToLog(); //throw new ApplicationException(exception.Message);
        }
        return objDs;
    }

    protected void gvSearchResult_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        ////throw new NotImplementedException();
        //WebControl wc = e.CommandSource as WebControl;
        //GridViewRow row = wc.NamingContainer as GridViewRow;

        //if (row != null)
        //{
        //    int DataItemIndex = row.DataItemIndex;
        //    DataSet ds = new DataSet();
        //    ds = GetDataSet();
        //    if (ds != null)
        //    {
        //        DataTable dt = ds.Tables[0];
        //        Session["User_ID"] = dt.Rows[DataItemIndex]["RoleID"].ToString();
        //    }

        //    if (e.CommandName == "Edit")
        //    {
        //        Response.Redirect("~/Admin/RoleMasterModify.aspx?RoleID=1");
        //    }
        //}
    }
   
}